\doxysubsection{dgr-\/udp-\/application.cc}
\hypertarget{dgr-udp-application_8cc_source}{}\label{dgr-udp-application_8cc_source}\index{model/dgr-\/udp-\/application.cc@{model/dgr-\/udp-\/application.cc}}
\mbox{\hyperlink{dgr-udp-application_8cc}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00001}00001\ \textcolor{comment}{/*\ -\/*-\/\ Mode:C++;\ c-\/file-\/style:"{}gnu"{};\ indent-\/tabs-\/mode:nil;\ -\/*-\/\ */}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00002}00002\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00003}00003\ \textcolor{comment}{//\ \#include\ <iostream>}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00004}00004\ \textcolor{comment}{//\ \#include\ "{}ns3/core-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00005}00005\ \textcolor{comment}{//\ \#include\ "{}ns3/network-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00006}00006\ \textcolor{comment}{//\ \#include\ "{}ns3/point-\/to-\/point-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00007}00007\ \textcolor{comment}{//\ \#include\ "{}ns3/applications-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00008}00008\ \textcolor{comment}{//\ \#include\ "{}ns3/internet-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00009}00009\ \textcolor{comment}{//\ \#include\ "{}ns3/flow-\/monitor-\/module.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00010}00010\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00011}00011\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{dgr-udp-application_8h}{dgr-\/udp-\/application.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00012}00012\ \textcolor{preprocessor}{\#include\ "{}ns3/timestamp-\/tag.h"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00013}00013\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{dgr-tags_8h}{dgr-\/tags.h}}"{}}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00014}00014\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00015}\mbox{\hyperlink{dgr-udp-application_8cc_a40760e9f2359c35da6f29e0a8fafb9ca}{00015}}\ \textcolor{preprocessor}{\#define\ MAX\_UINT\_32\ 0xffffffff}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00016}00016\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00017}00017\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00018}00018\ \textcolor{keyword}{namespace\ }\mbox{\hyperlink{namespacens3}{ns3}}\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00019}00019\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00020}\mbox{\hyperlink{namespacens3_aa6f2b59e2179ee3c3f85014c9e250460}{00020}}\ \mbox{\hyperlink{namespacens3_adde9ed23eff577cdfec10d85035e32eb}{NS\_LOG\_COMPONENT\_DEFINE}}\ (\textcolor{stringliteral}{"{}DGRUdpApplication"{}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00021}00021\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00022}\mbox{\hyperlink{namespacens3_afa090c96332a768ac95fbeb64a034620}{00022}}\ \mbox{\hyperlink{namespacens3_aef8bf32b4f2f98d854532bfb36d47a7c}{NS\_OBJECT\_ENSURE\_REGISTERED}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application}{DGRUdpApplication}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00023}00023\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00024}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a789f5dd5d50db1e9d60f7f7618098f0d}{00024}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a789f5dd5d50db1e9d60f7f7618098f0d}{DGRUdpApplication::DGRUdpApplication}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00025}00025\ \ \ :\ m\_socket\ (nullptr),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00026}00026\ \ \ \ \ m\_peer\ (),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00027}00027\ \ \ \ \ m\_packetSize\ (0),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00028}00028\ \ \ \ \ m\_nPackets\ (0),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00029}00029\ \ \ \ \ m\_dataRate\ (0),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00030}00030\ \ \ \ \ m\_sendEvent\ (),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00031}00031\ \ \ \ \ m\_running\ (false),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00032}00032\ \ \ \ \ m\_packetSent\ (0),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00033}00033\ \ \ \ \ m\_budget\ (\mbox{\hyperlink{dgr-tcp-application_8cc_a40760e9f2359c35da6f29e0a8fafb9ca}{MAX\_UINT\_32}}),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00034}00034\ \ \ \ \ m\_flag\ (false),}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00035}00035\ \ \ \ \ m\_vbr\ (false)}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00036}00036\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00037}00037\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00038}00038\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00039}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ad7423806aaf0be2db0e87be4d30dae7f}{00039}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ad7423806aaf0be2db0e87be4d30dae7f}{DGRUdpApplication::\string~DGRUdpApplication}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00040}00040\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00041}00041\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00042}00042\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00043}00043\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00044}00044\ TypeId}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00045}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_adf5ede44035ee65db58c501d67f01d07}{00045}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_adf5ede44035ee65db58c501d67f01d07}{DGRUdpApplication::GetTypeId}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00046}00046\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00047}00047\ \ \ \textcolor{keyword}{static}\ TypeId\ tid\ =\ TypeId\ (\textcolor{stringliteral}{"{}ns3::DGRUdpApplication"{}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00048}00048\ \ \ \ \ .SetParent<\mbox{\hyperlink{class_application}{Application}}>\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00049}00049\ \ \ \ \ .SetGroupName(\textcolor{stringliteral}{"{}DGRv2"{}})\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00050}00050\ \ \ \ \ .AddConstructor<\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application}{DGRUdpApplication}}>\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00051}00051\ \ \ \ \ \textcolor{comment}{//\ .AddAttribute\ ("{}Variable\_bitrate"{},}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00052}00052\ \ \ \ \ \textcolor{comment}{//\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "{}Enable\ the\ VBR"{},}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00053}00053\ \ \ \ \ \textcolor{comment}{//\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ BooleanValue\ (false),}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00054}00054\ \ \ \ \ \textcolor{comment}{//\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MakeBooleanAccessor\ (\&DGRUdpApplication::m\_vbr),}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00055}00055\ \ \ \ \ \textcolor{comment}{//\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MakeBooleanChecker\ ())}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00056}00056\ \ \ ;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00057}00057\ \ \ \textcolor{keywordflow}{return}\ tid;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00058}00058\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00059}00059\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00060}00060\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00061}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a2e5af196e076be85b8442c5375bc3e7e}{00061}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a2e5af196e076be85b8442c5375bc3e7e}{DGRUdpApplication::Setup}}\ (Ptr<Socket>\ socket,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00062}00062\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Address\ sinkAddress,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00063}00063\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ packetSize,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00064}00064\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ nPackets,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00065}00065\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DataRate\ dataRate,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00066}00066\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ budget,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00067}00067\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ flag)}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00068}00068\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00069}00069\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}\ =\ socket;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00070}00070\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a054ebc8dca3d709e0ef224465ec2d9bc}{m\_peer}}\ =\ sinkAddress;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00071}00071\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae51a9c8759e37e18a79e058ef519bcce}{m\_packetSize}}\ =\ packetSize;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00072}00072\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a96e0bf33b34279f8ac18d854702da5e5}{m\_nPackets}}\ =\ nPackets;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00073}00073\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a0c89a7a5f07d90b347e46045b03e7c7a}{m\_dataRate}}\ =\ dataRate;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00074}00074\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_abd5375f6282c6727baa7fb565cff8a3e}{m\_budget}}\ =\ budget;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00075}00075\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a3cb6df6b08f1d2e547e56bee6581a5fc}{m\_flag}}\ =\ flag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00076}00076\ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00077}00077\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00078}00078\ \ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00079}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_adb264cf9c38a6270a7f56faf5a4ff4a3}{00079}}\ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a2e5af196e076be85b8442c5375bc3e7e}{DGRUdpApplication::Setup}}\ (Ptr<Socket>\ socket,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00080}00080\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Address\ sinkAddress,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00081}00081\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ packetSize,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00082}00082\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ nPackets,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00083}00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DataRate\ dataRate,}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00084}00084\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ flag)}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00085}00085\ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00086}00086\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}\ =\ socket;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00087}00087\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a054ebc8dca3d709e0ef224465ec2d9bc}{m\_peer}}\ =\ sinkAddress;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00088}00088\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae51a9c8759e37e18a79e058ef519bcce}{m\_packetSize}}\ =\ packetSize;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00089}00089\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a96e0bf33b34279f8ac18d854702da5e5}{m\_nPackets}}\ =\ nPackets;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00090}00090\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a0c89a7a5f07d90b347e46045b03e7c7a}{m\_dataRate}}\ =\ dataRate;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00091}00091\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a3cb6df6b08f1d2e547e56bee6581a5fc}{m\_flag}}\ =\ flag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00092}00092\ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00093}00093\ \ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00094}00094\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00095}00095\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00096}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ada9c016c08e91a65da084c790acd4618}{00096}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ada9c016c08e91a65da084c790acd4618}{DGRUdpApplication::StartApplication}}\ (\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00097}00097\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00098}00098\ \ \ \ \ std::cout\ <<\ \textcolor{stringliteral}{"{}?????????????"{}};}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00099}00099\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a592e26fa24bf64e140f33f6853b7c2f9}{m\_running}}\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00100}00100\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_abca558ff6138a432a1ed7413b2fe2fd7}{m\_packetSent}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00101}00101\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}-\/>Bind\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00102}00102\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}-\/>Connect\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a054ebc8dca3d709e0ef224465ec2d9bc}{m\_peer}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00103}00103\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a844392732fe5f6e197992c862c4151db}{SendPacket}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00104}00104\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00105}00105\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00106}00106\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00107}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab68d0f087fac0f3d02e3c8717b8cc21}{00107}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab68d0f087fac0f3d02e3c8717b8cc21}{DGRUdpApplication::StopApplication}}\ (\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00108}00108\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00109}00109\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a592e26fa24bf64e140f33f6853b7c2f9}{m\_running}}\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00110}00110\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aec2ba587631beecd7da9f53b39909706}{m\_sendEvent}}.IsRunning\ ())}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00111}00111\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00112}00112\ \ \ \ \ \ \ \ \ Simulator::Cancel\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aec2ba587631beecd7da9f53b39909706}{m\_sendEvent}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00113}00113\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00114}00114\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00115}00115\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00116}00116\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}-\/>Close\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00117}00117\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00118}00118\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00119}00119\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00120}00120\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00121}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a844392732fe5f6e197992c862c4151db}{00121}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a844392732fe5f6e197992c862c4151db}{DGRUdpApplication::SendPacket}}()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00122}00122\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00123}00123\ \ \ \ \ TimestampTag\ txTimeTag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00124}00124\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_flag_tag}{FlagTag}}\ flagTag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00125}00125\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_budget_tag}{BudgetTag}}\ budgetTag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00126}00126\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_priority_tag}{PriorityTag}}\ priorityTag;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00127}00127\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00128}00128\ \ \ \ \ Ptr<Packet>\ packet\ =\ Create\ <Packet>\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae51a9c8759e37e18a79e058ef519bcce}{m\_packetSize}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00129}00129\ \ \ \ \ Time\ txTime\ =\ Simulator::Now\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00130}00130\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_abd5375f6282c6727baa7fb565cff8a3e}{m\_budget}}\ !=\ \mbox{\hyperlink{dgr-tcp-application_8cc_a40760e9f2359c35da6f29e0a8fafb9ca}{MAX\_UINT\_32}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00131}00131\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00132}00132\ \ \ \ \ \ \ \ \ budgetTag.\mbox{\hyperlink{classns3_1_1_budget_tag_a42dfab1331f4f1bb1953c1ec972ab0bb}{SetBudget}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_abd5375f6282c6727baa7fb565cff8a3e}{m\_budget}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00133}00133\ \ \ \ \ \ \ \ \ priorityTag.\mbox{\hyperlink{classns3_1_1_priority_tag_a2c4ada4770b0f4c6049edb3463da82a4}{SetPriority}}\ (1);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00134}00134\ \ \ \ \ \ \ \ \ packet-\/>AddPacketTag\ (budgetTag);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00135}00135\ \ \ \ \ \ \ \ \ packet-\/>AddPacketTag\ (priorityTag);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00136}00136\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00137}00137\ \ \ \ \ flagTag.\mbox{\hyperlink{classns3_1_1_flag_tag_a92c961c9c9e46744bf73cf82399e68df}{SetFlag}}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a3cb6df6b08f1d2e547e56bee6581a5fc}{m\_flag}});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00138}00138\ \ \ \ \ txTimeTag.SetTimestamp\ (txTime);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00139}00139\ \ \ \ \ packet-\/>AddPacketTag\ (txTimeTag);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00140}00140\ \ \ \ \ packet-\/>AddPacketTag\ (flagTag);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00141}00141\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aab22ae4139e567c50bacd3e231407147}{m\_socket}}-\/>Send\ (packet);}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00142}00142\ \ \ \ \ \textcolor{keywordflow}{if}(++\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_abca558ff6138a432a1ed7413b2fe2fd7}{m\_packetSent}}\ <\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a96e0bf33b34279f8ac18d854702da5e5}{m\_nPackets}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00143}00143\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00144}00144\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a217460003efed056634b84d512c0f47b}{ScheduleTx}}\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00145}00145\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00146}00146\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00147}00147\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00148}00148\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00149}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a217460003efed056634b84d512c0f47b}{00149}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a217460003efed056634b84d512c0f47b}{DGRUdpApplication::ScheduleTx}}\ ()}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00150}00150\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00151}00151\ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a592e26fa24bf64e140f33f6853b7c2f9}{m\_running}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00152}00152\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00153}00153\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a1df7eb2d3df2b8170a9fc452e0b2a49b}{m\_vbr}})}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00154}00154\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00155}00155\ \ \ \ \ \ \ \ \ \ \ \ \ Ptr<UniformRandomVariable>\ rand\ =\ CreateObject<UniformRandomVariable>\ ();}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00156}00156\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ rate\ =\ \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{double}\textcolor{keyword}{>}\ (rand-\/>GetInteger\ (1,\ 100))\ /\ 100;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00157}00157\ \ \ \ \ \ \ \ \ \ \ \ \ Time\ tNext\ (Seconds\ (rate\ *\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae51a9c8759e37e18a79e058ef519bcce}{m\_packetSize}}\ *\ 8\ /\ \textcolor{keyword}{static\_cast\ <}\textcolor{keywordtype}{double}\textcolor{keyword}{>}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a0c89a7a5f07d90b347e46045b03e7c7a}{m\_dataRate}}.GetBitRate())));}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00158}00158\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aec2ba587631beecd7da9f53b39909706}{m\_sendEvent}}\ =\ Simulator::Schedule\ (tNext,\ \&\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a844392732fe5f6e197992c862c4151db}{DGRUdpApplication::SendPacket}},\ \textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00159}00159\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00160}00160\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00161}00161\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00162}00162\ \ \ \ \ \ \ \ \ \ \ \ \ Time\ tNext\ (Seconds\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae51a9c8759e37e18a79e058ef519bcce}{m\_packetSize}}\ *\ 8\ /\ \textcolor{keyword}{static\_cast\ <}\textcolor{keywordtype}{double}\textcolor{keyword}{>}\ (\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a0c89a7a5f07d90b347e46045b03e7c7a}{m\_dataRate}}.GetBitRate())));}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00163}00163\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_aec2ba587631beecd7da9f53b39909706}{m\_sendEvent}}\ =\ Simulator::Schedule\ (tNext,\ \&\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a844392732fe5f6e197992c862c4151db}{DGRUdpApplication::SendPacket}},\ \textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00164}00164\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00165}00165\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00166}00166\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00167}00167\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00168}00168\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00169}\mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae7820a661567dee9c180baebda7a4429}{00169}}\ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_ae7820a661567dee9c180baebda7a4429}{DGRUdpApplication::ChangeRate}}\ (DataRate\ newDataRate)}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00170}00170\ \{}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00171}00171\ \ \ \ \ \mbox{\hyperlink{classns3_1_1_d_g_r_udp_application_a0c89a7a5f07d90b347e46045b03e7c7a}{m\_dataRate}}\ =\ newDataRate;}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00172}00172\ \}}
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00173}00173\ }
\DoxyCodeLine{\Hypertarget{dgr-udp-application_8cc_source_l00174}00174\ \}\ \textcolor{comment}{//\ namespace\ ns3}}

\end{DoxyCode}
